import 'package:dio/dio.dart';
import 'package:secend_flutter/bean/search_model_bean.dart';

Future<SearchModel> searchData(String url,String text) async{
  Response response;
  Dio dio =Dio();
  response=await dio.get(url);
  if(response.statusCode==200){
    SearchModel searchModel=SearchModel.fromJson(response.data);
    searchModel.keyWord =text;
    return searchModel;
  }else{
    throw Exception('获取数据失败++++++++++++++++++++++++++++++++++++++++++');
  }

}
